<template>
	<view>
		<view class="input user">
			用户名：<u--input v-model="username"></u--input>
		</view>
		<view class="input pass">
			密&nbsp;&nbsp;&nbsp;码：<u--input v-model="password"></u--input>
		
		</view>
			<view class="butbox">
			<view class="but"><button type="primary" @click="goreg">注册</button></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				username:"",
				password:""
			}
		},
		methods: {
			goreg(){
				let username=this.username
				let password=this.password
				uni.request({
					url:'http://localhost:8000/api/register',
					method:'POST',
					data:{
						username,password
					},
					success(res) {
						console.log(res);
					}
				})
			}
		}
	}
</script>

<style>
.input{
	display: flex;margin: 50rpx;
	align-items: center;
}
.butbox{
	width: 100%;
	display: flex;
	justify-content: center;
}
.but{
	width: 650rpx;
}

</style>
